package com.xqb.modules.service.impl;

import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.LesCourseContent;
import com.xqb.modules.mapper.LesCourseContentMapper;
import com.xqb.modules.service.ILesCourseContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课程内容Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-14
 */
@Service
public class LesCourseContentServiceImpl implements ILesCourseContentService 
{
    @Autowired
    private LesCourseContentMapper lesCourseContentMapper;

    /**
     * 查询课程内容
     * 
     * @param id 课程内容主键
     * @return 课程内容
     */
    @Override
    public LesCourseContent selectLesCourseContentById(Long id)
    {
        return lesCourseContentMapper.selectLesCourseContentById(id);
    }

    /**
     * 查询课程内容列表
     * 
     * @param lesCourseContent 课程内容
     * @return 课程内容
     */
    @Override
    public List<LesCourseContent> selectLesCourseContentList(LesCourseContent lesCourseContent)
    {
        return lesCourseContentMapper.selectLesCourseContentList(lesCourseContent);
    }

    /**
     * 新增课程内容
     * 
     * @param lesCourseContent 课程内容
     * @return 结果
     */
    @Override
    public int insertLesCourseContent(LesCourseContent lesCourseContent)
    {
        lesCourseContent.setCreateTime(DateUtils.getNowDate());
        return lesCourseContentMapper.insert(lesCourseContent);
    }

    /**
     * 修改课程内容
     * 
     * @param lesCourseContent 课程内容
     * @return 结果
     */
    @Override
    public int updateLesCourseContent(LesCourseContent lesCourseContent)
    {
        lesCourseContent.setUpdateTime(DateUtils.getNowDate());
        return lesCourseContentMapper.updateLesCourseContent(lesCourseContent);
    }

    /**
     * 批量删除课程内容
     * 
     * @param ids 需要删除的课程内容主键
     * @return 结果
     */
    @Override
    public int deleteLesCourseContentByIds(Long[] ids)
    {
        return lesCourseContentMapper.deleteLesCourseContentByIds(ids);
    }

    /**
     * 删除课程内容信息
     * 
     * @param id 课程内容主键
     * @return 结果
     */
    @Override
    public int deleteLesCourseContentById(Long id)
    {
        return lesCourseContentMapper.deleteLesCourseContentById(id);
    }
}
